package org.jeecg.common.system.api.factory;

import feign.hystrix.FallbackFactory;
import org.jeecg.common.system.api.SyncAPI;
import org.jeecg.common.system.api.fallback.SyncAPIFallback;
import org.springframework.stereotype.Component;

@Component
public class SyncAPIFallbackFactory implements FallbackFactory<SyncAPI> {

    @Override
    public SyncAPI create(Throwable throwable) {
        SyncAPIFallback fallback = new SyncAPIFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
